

var express = require('express');
var router = express.Router();

var verify = require('../controller/verify')
var access = require('../controller/access')
var replyMsg = require('../controller/replyMsg')
var pushNotifications = require('../controller/pushNotifications')
var setMenu = require('../controller/setMenu')
var geoCoder = require('../controller/geoCoder')

// 返回签名
router.get('/access', access)


// 验证服务器有效性.
router.get('/', verify)

/**坐标逆地址解析
 * @getLocation 获取用户坐标进行解析
 * 
 */
router.post('/geocoder', geoCoder)


/* @接收微信服务器的数据（用户消息，用户位置）
 * 也可接收其他数据
*/
router.post('/', replyMsg)


//推送模板消息给用户
router.get('/template', pushNotifications)

router.get('/setmenu', setMenu)

module.exports = router;
